package com.hskn.hss.module.alarmperson.entity;

import com.hskn.hss.core.annotation.Excel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.poi.ss.usermodel.IndexedColors;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author hskn
 * @since 2021-05-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class AlarmPersonCharts implements Serializable {

    /**
     * 人员Id
     */
    private String PersonId;
    /**
     * 人员名称
     */
    @Excel(name = "人员名称", align = Excel.Align.CENTER, height = 14, width = 16)
    private String PersonName;
    /**
     * 机构名称
     */
    @Excel(name = "机构名称", align = Excel.Align.CENTER, height = 14, width = 24)
    private String depName;
    /**
     * 工种id
     */
    private String personTypeId;
    /**
     * 全部
     */
    @Excel(name = "全部报警（次）", align = Excel.Align.CENTER, height = 14, width = 18, color = IndexedColors.DARK_RED)
    private Integer allCount = 0;
    /**
     * 机构Id
     */

    private String depId;
    /**
     * 离线报警数
     */
    @Excel(name = " 离线报警（次）", align = Excel.Align.CENTER, height = 14, width = 18, color = IndexedColors.DARK_YELLOW)
    private Integer lxCount = 0;
    /**
     * SOS求救
     */
    @Excel(name = "SOS求救（次）", align = Excel.Align.CENTER, height = 14, width = 18, color = IndexedColors.DARK_YELLOW)
    private Integer SOSCount = 0;
    /**
     * 时间
     */
    private String alarmTime;

    private List<String> resList;

    public List<Object> getResList() {
        List<Object> resList = new ArrayList<>();
        if (allCount != null) {
            resList.add(allCount);
        } else {
            resList.add(0);
        }
        if (lxCount != null) {
            resList.add(lxCount);
        } else {
            resList.add(0);
        }
        if (SOSCount != null) {
            resList.add(SOSCount);
        } else {
            resList.add(0);
        }
        return resList;
    }
}
